<template>
	<new-detail v-if="detailData" :item="detailData" />
</template>

<script setup>
	import { apiGetDetail } from '@/api/index.js'
	const detailData = ref(null)
	onLoad(({ id,cid }) => {
		getNewDetail({id,cid})
	})
	async function getNewDetail(data = {}) {
		const result = await apiGetDetail({
			...data
		})
		uni.setNavigationBarTitle({
			title: result?.title || '新闻详情'
		})
		// result.content.replace(/\<img/gi, "<img class='richImg'");
		detailData.value = result
	}
</script>

<style lang="scss">
.richImg {
	height: 100%;
	width: 100%;
}
</style>
